<!DOCTYPE html>
<html>

<head lang="en">
    <title>骡窝日报</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/reset.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/index.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/news.css"/>
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/common.js"></script>
    <link rel="stylesheet" href="js/plugins/dialog2/dialog.css">
    <script src="js/plugins/dialog2/dialog.min.js"></script>


</head>
<body>

<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="index.html">
                <span><i class="fa fa-chevron-left fa-2x"></i></span>
            </a>
        </div>
        <div class="col-10">
            <div class="input-group-sm search">
                <input class="form-control searchBtn" placeholder="搜索资讯">
            </div>
        </div>
    </div>
</div>

<div class="container">
    <h6 class="news-title">骡窝日报 </h6>
    <div class="news">
        <div class="row" render-loop="list">
            <div class="col-6">
                <a href="newsContent.html?id=" render-fun="setHref" render-key="list.id">
                    <img class="rounded " width="100%" height="100px" render-src="list.coverUrl">
                </a>
                <div class="caption">
                    <p>
                        <span render-html="list.releaseTime">ccc </span>

                    </p>
                    <a href="newsContent.html?id=" render-fun="setHref" render-key="list.id">
                        <p render-html="list.title"></p>
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<style>
    .fa-heart:before {
        content: "\f004";
    }


</style>
<script>
    $(function () {
        var userStr = sessionStorage.getItem('user');
        var user = JSON.parse(userStr);
        var userId = user.id;
        var newsId;

        //滑动分页
        var currentPage = 1;
        var dataList = [];
        var totalPage = 1;

        function query() {
            $.get("/news/list", {currentPage: currentPage, pageSize: 0}, function (data) {
                $.merge(dataList, data.list);
                $(".news").renderValues({list: dataList}, {
                    setHref: function (item, value) {
                        var href = $(item).attr("href") + value;
                        $(item).attr("href", href);
                    }
                });
                currentPage = currentPage + 1;
                totalPage = data.pages;
            })
        }
        query();

        /*$(window).scroll(function () {
            if ($(window).height() + $(window).scrollTop() + 4 >= $(document).height()) {
                if (currentPage <= totalPage) {
                    query();
                } else {
                    $(document).dialog({
                        type: 'notice',
                        infoText: '亲.我也是有限度的',
                        autoClose: 2500,
                        position: 'bottom'  // center: 居中; bottom: 底部
                    });
                }
            }
        })*/


    });


</script>
</html>